﻿Imports System.Data.SqlClient

Public Class cn_columnlist
    Inherits System.Web.UI.Page
    Private sSQL As String
    Private objfind As New GetData
    Private objrd As SqlDataReader = Nothing
    Private ps As New PreparedStatement(sSQL)
    Dim strErr As String = ""
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim strNID, colID As String
       
        strNID = Trim(Request("newsId"))
        ps.addParameter("id", strNID)
        sSQL = "select * from Column_New where New_ID=@id"
        ps.strSql = sSQL
        Dim conn As SqlConnection = objfind.getConn()

        objrd = objfind.dr(ps, strErr, conn, objrd)
        If objrd.HasRows Then
            While (objrd.Read())
                newsTitle.InnerHtml = objrd("title").ToString
                newsDate.InnerHtml = objrd("news_date").ToString
                imageDiv.InnerHtml = "<img src=""" & objrd("photo_path") & """  />"
                newsContent.InnerHtml = objrd("context").ToString
                colID = objrd("Column_ID").ToString
            End While
            sSQL = "select * from Columns where Column_ID=@cid"
            ps.strSql = sSQL
            ps.addParameter("cid", colID)
            objrd = objfind.dr(ps, strErr, conn, objrd)
            If objrd.HasRows Then
                While (objrd.Read())

                    colName.InnerText = objrd("Column_Name").ToString

                End While
            End If
        End If
        objfind.closeConn(conn)

       
    End Sub

End Class